package com.xys.auth.service.impl;

import com.xys.auth.bean.Syslog;
import com.xys.auth.mapper.SyslogMapper;
import com.xys.auth.service.ISyslogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class SyslogServiceImpl implements ISyslogService {
    @Autowired
    private SyslogMapper syslogMapper;

    @Override
    public void save(Syslog syslog) throws Exception {

        syslog.setId(UUID.randomUUID().toString().replaceAll("-",""));
        syslogMapper.save(syslog);

    }

    @Override
    public List<Syslog> findAll() throws Exception {
        return syslogMapper.findAll();
    }
}
